# Scrapy settings for ccx_scrapy project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
#     https://docs.scrapy.org/en/latest/topics/settings.html
#     https://docs.scrapy.org/en/latest/topics/downloader-middleware.html
#     https://docs.scrapy.org/en/latest/topics/spider-middleware.html

BOT_NAME = 'ccx_scrapy'

SPIDER_MODULES = ['ccx_scrapy.spiders']
NEWSPIDER_MODULE = 'ccx_scrapy.spiders'


# Crawl responsibly by identifying yourself (and your website) on the user-agent
#USER_AGENT = 'ccx_scrapy (+http://www.yourdomain.com)'

# Obey robots.txt rules
ROBOTSTXT_OBEY = True

# Configure maximum concurrent requests performed by Scrapy (default: 16)
#CONCURRENT_REQUESTS = 32

# Configure a delay for requests for the same website (default: 0)
# See https://docs.scrapy.org/en/latest/topics/settings.html#download-delay
# See also autothrottle settings and docs
#DOWNLOAD_DELAY = 3
# The download delay setting will honor only one of:
#CONCURRENT_REQUESTS_PER_DOMAIN = 16
#CONCURRENT_REQUESTS_PER_IP = 16

# Disable cookies (enabled by default)
#COOKIES_ENABLED = False

# Disable Telnet Console (enabled by default)
#TELNETCONSOLE_ENABLED = False

# Override the default request headers:
#DEFAULT_REQUEST_HEADERS = {
DEFAULT_REQUEST_HEADERS = {
    'accept': 'application/json, text/plain, */*',
    'accept-encoding': 'gzip, deflate, br',
    'accept-language': 'zh-CN,zh;q=0.9',
    'cookie': 'ttwid=1|S8yIGymJkdskv51b-FB0CM53B2VXFXmJMdNg5COanHs|1714378436|6937db8ce6015ede30ea1358d9de20b4f6750ca1b86b09eb454de04fb97d8363; douyin.com; device_web_cpu_core=4; device_web_memory_size=8; architecture=amd64; dy_swidth=1920; dy_sheight=1080; strategyABtestKey="1714378565.518"; xgplayer_user_id=741635526928; csrf_session_id=bb0bd0b35471bf5977fef169e2104b01; FORCE_LOGIN={"videoConsumedRemainSeconds":180}; passport_csrf_token=2e5a3fe48229ea032d0be25261720872; passport_csrf_token_default=2e5a3fe48229ea032d0be25261720872; volume_info={"isUserMute":true,"isMute":true,"volume":0.6}; bd_ticket_guard_client_web_domain=2; xg_device_score=7.064976813718618; pwa2="0|0|1|0"; WallpaperGuide={"showTime":1714380432007,"closeTime":0,"showCount":1,"cursor1":7,"cursor2":0}; __ac_nonce=0662f5f56002877916676; __ac_signature=_02B4Z6wo00f01In2hsQAAIDCMeT5wGL8ZHyJ1oJAAERXc2; stream_recommend_feed_params="{\"cookie_enabled\":true,\"screen_width\":1920,\"screen_height\":1080,\"browser_online\":true,\"cpu_core_num\":4,\"device_memory\":8,\"downlink\":10,\"effective_type\":\"4g\",\"round_trip_time\":50}"; s_v_web_id=verify_lvkpzjpf_yPMtXjVU_P5Cr_4Vnx_87SN_dyi7CMumuO6w; d_ticket=d6567ab32b468e83344c9f0f4e0447fcd686c; passport_assist_user=CkG9G3d5gJ6uDraSrP7i5SDQYL2Rinf0LbONNkZdu4BNIm79mfJFE3lpevRWDe-1wNXIDKY_wFMT0U1uq04xvUvqexpKCjyUDTBDo6DmRgtBHiLLbhLijomsu_1ATUMPL9SEhhpjKKl6CH3uAa6qoALEEhXaj7ENIqTxb2aB2oxEAAIQu_rPDRiJr9ZUIAEiAQPhOHiX; n_mh=sP-CDV08lK7ZRk23a9JW16q61G5YHWyC2yt2_TftsSc; sso_uid_tt=571b0e9dcbefb41e69978b9b3bc76cee; sso_uid_tt_ss=571b0e9dcbefb41e69978b9b3bc76cee; toutiao_sso_user=7cabac17f24c114ab66a1797b80ee498; toutiao_sso_user_ss=7cabac17f24c114ab66a1797b80ee498; sid_ucp_sso_v1=1.0.0-KGM5MzE3MjU2MjMzZGMxZTA3MmYyNTU3OTFlYWFmNTFjNjliYzkxMDEKHwjj8LCI0vS5BBCUv72xBhjvMSAMMObAyPIFOAZA9AcaAmhsIiA3Y2FiYWMxN2YyNGMxMTRhYjY2YTE3OTdiODBlZTQ5OA; ssid_ucp_sso_v1=1.0.0-KGM5MzE3MjU2MjMzZGMxZTA3MmYyNTU3OTFlYWFmNTFjNjliYzkxMDEKHwjj8LCI0vS5BBCUv72xBhjvMSAMMObAyPIFOAZA9AcaAmhsIiA3Y2FiYWMxN2YyNGMxMTRhYjY2YTE3OTdiODBlZTQ5OA; passport_auth_status=d69fb54fe25e3250a9085b576c96bf55,; passport_auth_status_ss=d69fb54fe25e3250a9085b576c96bf55,; uid_tt=12ef3c50cec8bb9fbd5c862e9f53c162; uid_tt_ss=12ef3c50cec8bb9fbd5c862e9f53c162; sid_tt=88dd9b7dfd0e62289091495d6cfcde5b; sessionid=88dd9b7dfd0e62289091495d6cfcde5b; sessionid_ss=88dd9b7dfd0e62289091495d6cfcde5b; LOGIN_STATUS=1; stream_player_status_params="{\"is_auto_play\":0,\"is_full_screen\":0,\"is_full_webscreen\":0,\"is_mute\":1,\"is_speed\":1,\"is_visible\":1}"; passport_fe_beating_status=true; _bd_ticket_crypt_doamin=2; _bd_ticket_crypt_cookie=6ef3a392caf9f63228c103eb4ffb8cb1; __security_server_data_status=1; bd_ticket_guard_client_data=eyJiZC10aWNrZXQtZ3VhcmQtdmVyc2lvbiI6MiwiYmQtdGlja2V0LWd1YXJkLWl0ZXJhdGlvbi12ZXJzaW9uIjoxLCJiZC10aWNrZXQtZ3VhcmQtcmVlLXB1YmxpYy1rZXkiOiJCQ0dGRmFhdkQyaGpEaVBMSXllcHNwYUx0UnUxZzdaYkw0MjlFVFo0VDVPT2Z0SEZSRWNZV0FUS0ZBZEgweStYREM5SXFDZ09MaDBpSk4wL1BFUDlRWEU9IiwiYmQtdGlja2V0LWd1YXJkLXdlYi12ZXJzaW9uIjoxfQ==; sid_guard=88dd9b7dfd0e62289091495d6cfcde5b|1714380700|5183995|Fri,+28-Jun-2024+08:51:35+GMT; sid_ucp_v1=1.0.0-KGRjYjc1ZWQ2NWY5YjliZWNiYzhiNDdjNWE4MTg1NmUzMzU4ODg1NWMKGwjj8LCI0vS5BBCcv72xBhjvMSAMOAZA9AdIBBoCbHEiIDg4ZGQ5YjdkZmQwZTYyMjg5MDkxNDk1ZDZjZmNkZTVi; ssid_ucp_v1=1.0.0-KGRjYjc1ZWQ2NWY5YjliZWNiYzhiNDdjNWE4MTg1NmUzMzU4ODg1NWMKGwjj8LCI0vS5BBCcv72xBhjvMSAMOAZA9AdIBBoCbHEiIDg4ZGQ5YjdkZmQwZTYyMjg5MDkxNDk1ZDZjZmNkZTVi; IsDouyinActive=true; home_can_add_dy_2_desktop="1"; FOLLOW_LIVE_POINT_INFO="MS4wLjABAAAApWBBXYlcjg6RHm7FsiFO3tFLOflyo6tC5lTwj0TlkWnSkpKZ58E8PRp3OAEV3nPc/1714406400000/0/1714380701040/0"; publish_badge_show_info="0,0,0,1714380701142"; store-region=cn-fj; store-region-src=uid; odin_tt=4fac72e682dec224952f6794fd92baa74e09c9244f2caa8247aef351bb62ea4268554e14e036e14bf573e7c3bb081a590fa4bae4dbf61b6b9d0ef7564220d446; download_guide="2/20240429/0"; msToken=ROoJ2xIIR-fHPNePBzHThUYqfX--4LNcdLO3NZ9r_OhwacHDnh2X0ZClYhOCDKFR6pjPG4VqgpB_jQlU8uoAmXXn001aTGjdWqgz-_SUaumqAXPcGAOs',
    'referer': 'https://www.douyin.com/?recommend=1',
    'sec-ch-ua': '"Not_A Brand";v="99", "Google Chrome";v="109", "Chromium";v="109"',
    'sec-ch-ua-mobile': '?0',
    'sec-ch-ua-platform': '"Windows"',
    'sec-fetch-dest': 'empty',
    'sec-fetch-mode': 'cors',
    'sec-fetch-site': 'same-origin',
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36'
}


#   'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
#   'Accept-Language': 'en',
#}

# Enable or disable spider middlewares
# See https://docs.scrapy.org/en/latest/topics/spider-middleware.html
#SPIDER_MIDDLEWARES = {
#    'ccx_scrapy.middlewares.CcxScrapySpiderMiddleware': 543,
#}

# Enable or disable downloader middlewares
# See https://docs.scrapy.org/en/latest/topics/downloader-middleware.html
#DOWNLOADER_MIDDLEWARES = {
#    'ccx_scrapy.middlewares.CcxScrapyDownloaderMiddleware': 543,
#}

# Enable or disable extensions
# See https://docs.scrapy.org/en/latest/topics/extensions.html
#EXTENSIONS = {
#    'scrapy.extensions.telnet.TelnetConsole': None,
#}

# Configure item pipelines
# See https://docs.scrapy.org/en/latest/topics/item-pipeline.html
#ITEM_PIPELINES = {
#    'ccx_scrapy.pipelines.CcxScrapyPipeline': 300,
#}

# Enable and configure the AutoThrottle extension (disabled by default)
# See https://docs.scrapy.org/en/latest/topics/autothrottle.html
#AUTOTHROTTLE_ENABLED = True
# The initial download delay
#AUTOTHROTTLE_START_DELAY = 5
# The maximum download delay to be set in case of high latencies
#AUTOTHROTTLE_MAX_DELAY = 60
# The average number of requests Scrapy should be sending in parallel to
# each remote server
#AUTOTHROTTLE_TARGET_CONCURRENCY = 1.0
# Enable showing throttling stats for every response received:
#AUTOTHROTTLE_DEBUG = False

# Enable and configure HTTP caching (disabled by default)
# See https://docs.scrapy.org/en/latest/topics/downloader-middleware.html#httpcache-middleware-settings
#HTTPCACHE_ENABLED = True
#HTTPCACHE_EXPIRATION_SECS = 0
#HTTPCACHE_DIR = 'httpcache'
#HTTPCACHE_IGNORE_HTTP_CODES = []
#HTTPCACHE_STORAGE = 'scrapy.extensions.httpcache.FilesystemCacheStorage'
